import request from '@/utils/request'
// 返修领料单列表

// 查询返修领料单列表
export function listRepair(params) {
  return request({
    url: '/erp/repairMaterial/list',
    method: 'get',
    params
  })
}

// 返修列表子菜单查询
export function listRepairChild(params) {
  return request({
    url: '/erp/repairMaterialPart/list',
    method: 'get',
    params
  })
}

// 生成领料单
export function generateMaterial(data) {
  return request({
    url: '/erp/repairMaterial/generateMaterial',
    method: 'post',
    data
  })
}

// 新增
export function addRepair(data) {
  return request({
    url: '/erp/repairProductMaterialRequisition',
    method: 'post',
    data
  })
}

// 新增筛选的产品列表
export function getProductList(params) {
  return request({
    url: '/erp/repairProductMaterialRequisition/repairProductList',
    method: 'get',
    params: params
  })
}

// 删除返修领料单列表
export function delProductList(id) {
  return request({
    url: '/erp/repairMaterial/' + id,
    method: 'delete'
  })
}

// 提交审批
export function submitProduction(data) {
  return request({
    url: '/erp/repairMaterial/submitRepairProduct',
    method: 'post',
    data
  })
}

// 审批
export function productionApprove(data) {
  return request({
    url: '/erp/repairMaterial/approverRepair',
    method: 'post',
    data
  })
}

// 删除子菜单
export function delProductListChild(id) {
  return request({
    url: '/erp/repairMaterialPart/' + id,
    method: 'delete'
  })
}

// 获取零组件详情
export function getProductInfo(id) {
  return request({
    url: '/erp/repairMaterialPart/' + id,
    method: 'get',
  })
}

// 编辑零组件
export function editProductInfo(data) {
  return request({
    url: '/erp/repairMaterialPart',
    method: 'put',
    data
  })
}


// 修改父级
export function editrepairMaterial(data) {
  return request({
    url: '/erp/repairMaterial',
    method: 'put',
    data
  })
}
